<template>
    <van-dropdown-menu style="margin-bottom: 0.5rem;">
        <van-dropdown-item v-model="statusFilter" :options="statusFilterList" @change="handleConditionsChange" />
        <van-dropdown-item v-model="filter" :options="filterList" @change="handleConditionsChange" disabled />
    </van-dropdown-menu>
</template>
<script setup>
import { ref, reactive } from "vue";
import { getTransformedDict } from '@/utils/Misc.js';
const props = defineProps(["dictName", "type"]);
const emit = defineEmits(["change-conditions"]);
const statusFilter = ref(null);
const filter = ref(null);
const statusFilterList = ref(getTransformedDict(props.dictName, props.type));
const filterList = ref([
    { text: "待定", value: null },
]);
const queryConditions = reactive({
    status: null,
});
const handleConditionsChange = () => {
    queryConditions.status = statusFilter.value;
    queryConditions.orderBy = filter.value;
    emit("change-conditions", { ...queryConditions });
};
</script>
